opt subtitle "HI-TECH Software Omniscient Code Generator (Lite mode) build 10920"

opt pagewidth 120

	opt lm

	processor	16F887
clrc	macro
	bcf	3,0
	endm
clrz	macro
	bcf	3,2
	endm
setc	macro
	bsf	3,0
	endm
setz	macro
	bsf	3,2
	endm
skipc	macro
	btfss	3,0
	endm
skipz	macro
	btfss	3,2
	endm
skipnc	macro
	btfsc	3,0
	endm
skipnz	macro
	btfsc	3,2
	endm
indf	equ	0
indf0	equ	0
pc	equ	2
pcl	equ	2
status	equ	3
fsr	equ	4
fsr0	equ	4
c	equ	1
z	equ	0
pclath	equ	10
# 6 "D:\working code\trunk\i2c\i2c main.c"
	psect config,class=CONFIG,delta=2 ;#
# 6 "D:\working code\trunk\i2c\i2c main.c"
	dw 0xFFFA & 0xFFF7 & 0xFFEF & 0xFFFF & 0xFCFF & 0xFBFF & 0xF7FF & 0xEFFF & 0xFFFF ;#
# 8 "D:\working code\trunk\i2c\i2c main.c"
	psect config,class=CONFIG,delta=2 ;#
# 8 "D:\working code\trunk\i2c\i2c main.c"
	dw 0xFEFF ;#
	FNCALL	_main,_init_port
	FNCALL	_main,_i2c_init
	FNCALL	_main,_timer1_init
	FNCALL	_main,_clock_read
	FNCALL	_clock_read,_i2c_start
	FNCALL	_clock_read,_i2c_write
	FNCALL	_clock_read,_i2c_stop
	FNCALL	_clock_read,_i2c_read
	FNROOT	_main
	FNCALL	intlevel1,_isr
	global	intlevel1
	FNROOT	intlevel1
	global	_X_M
	global	_Y_M
	global	_Z_L
	global	_Z_M
	global	_chuoidate
	global	_chuoiday
	global	_chuoihour
	global	_chuoimin
	global	_chuoimonth
	global	_chuoisec
	global	_chuoiyear
	global	_X_L
	global	_Y_L
	global	_status
	global	_PORTB
psect	text390,local,class=CODE,delta=2
global __ptext390
__ptext390:
_PORTB	set	6
	global	_RCREG
_RCREG	set	26
	global	_SSPBUF
_SSPBUF	set	19
	global	_SSPCON
_SSPCON	set	20
	global	_TMR1H
_TMR1H	set	15
	global	_TMR1L
_TMR1L	set	14
	global	_TXREG
_TXREG	set	25
	global	_CARRY
_CARRY	set	24
	global	_CREN
_CREN	set	196
	global	_GIE
_GIE	set	95
	global	_PEIE
_PEIE	set	94
	global	_RC3
_RC3	set	59
	global	_RC4
_RC4	set	60
	global	_RCIF
_RCIF	set	101
	global	_RX9
_RX9	set	198
	global	_SPEN
_SPEN	set	199
	global	_SREN
_SREN	set	197
	global	_SSPIF
_SSPIF	set	99
	global	_T1CKPS0
_T1CKPS0	set	132
	global	_T1CKPS1
_T1CKPS1	set	133
	global	_TMR1CS
_TMR1CS	set	129
	global	_TMR1GE
_TMR1GE	set	134
	global	_TMR1IF
_TMR1IF	set	96
	global	_TMR1ON
_TMR1ON	set	128
	global	_TXIF
_TXIF	set	100
	global	_WCOL
_WCOL	set	167
	global	_SPBRG
_SPBRG	set	153
	global	_SSPADD
_SSPADD	set	147
	global	_SSPCON2
_SSPCON2	set	145
	global	_TRISB
_TRISB	set	134
	global	_ACKDT
_ACKDT	set	1165
	global	_ACKEN
_ACKEN	set	1164
	global	_ACKSTAT
_ACKSTAT	set	1166
	global	_BRGH
_BRGH	set	1218
	global	_PEN
_PEN	set	1162
	global	_RCEN
_RCEN	set	1163
	global	_RCIE
_RCIE	set	1125
	global	_SEN
_SEN	set	1160
	global	_SMP
_SMP	set	1191
	global	_SYNC
_SYNC	set	1220
	global	_TMR1IE
_TMR1IE	set	1120
	global	_TRISC3
_TRISC3	set	1083
	global	_TRISC4
_TRISC4	set	1084
	global	_TRISC6
_TRISC6	set	1086
	global	_TRISC7
_TRISC7	set	1087
	global	_TX9
_TX9	set	1222
	global	_TXEN
_TXEN	set	1221
	global	_TXIE
_TXIE	set	1124
	global	_EEADR
_EEADR	set	269
	global	_EEDATA
_EEDATA	set	268
	global	_ANSEL
_ANSEL	set	392
	global	_ANSELH
_ANSELH	set	393
	global	_EECON1
_EECON1	set	396
	global	_EECON2
_EECON2	set	397
	global	_RD
_RD	set	3168
	global	_WR
_WR	set	3169
	global	_WREN
_WREN	set	3170
	file	"i2c.as"
	line	#
psect cinit,class=CODE,delta=2
global start_initialization
start_initialization:

psect	bssCOMMON,class=COMMON,space=1
global __pbssCOMMON
__pbssCOMMON:
_X_L:
       ds      2

_Y_L:
       ds      2

_status:
       ds      2

psect	bssBANK0,class=BANK0,space=1
global __pbssBANK0
__pbssBANK0:
_X_M:
       ds      2

_Y_M:
       ds      2

_Z_L:
       ds      2

_Z_M:
       ds      2

_chuoidate:
       ds      2

_chuoiday:
       ds      2

_chuoihour:
       ds      2

_chuoimin:
       ds      2

_chuoimonth:
       ds      2

_chuoisec:
       ds      2

_chuoiyear:
       ds      2

psect clrtext,class=CODE,delta=2
global clear_ram
;	Called with FSR containing the base address, and
;	W with the last address+1
clear_ram:
	clrwdt			;clear the watchdog before getting into this loop
clrloop:
	clrf	indf		;clear RAM location pointed to by FSR
	incf	fsr,f		;increment pointer
	xorwf	fsr,w		;XOR with final address
	btfsc	status,2	;have we reached the end yet?
	retlw	0		;all done for this memory range, return
	xorwf	fsr,w		;XOR again to restore value
	goto	clrloop		;do the next byte

; Clear objects allocated to COMMON
psect cinit,class=CODE,delta=2
	clrf	((__pbssCOMMON)+0)&07Fh
	clrf	((__pbssCOMMON)+1)&07Fh
	clrf	((__pbssCOMMON)+2)&07Fh
	clrf	((__pbssCOMMON)+3)&07Fh
	clrf	((__pbssCOMMON)+4)&07Fh
	clrf	((__pbssCOMMON)+5)&07Fh
; Clear objects allocated to BANK0
psect cinit,class=CODE,delta=2
	bcf	status, 7	;select IRP bank0
	movlw	low(__pbssBANK0)
	movwf	fsr
	movlw	low((__pbssBANK0)+016h)
	fcall	clear_ram
psect cinit,class=CODE,delta=2
global end_of_initialization

;End of C runtime variable initialization code

end_of_initialization:
clrf status
ljmp _main	;jump to C main() function
psect	cstackCOMMON,class=COMMON,space=1
global __pcstackCOMMON
__pcstackCOMMON:
	global	?_i2c_start
?_i2c_start:	; 0 bytes @ 0x0
	global	?_i2c_stop
?_i2c_stop:	; 0 bytes @ 0x0
	global	?_i2c_init
?_i2c_init:	; 0 bytes @ 0x0
	global	?_init_port
?_init_port:	; 0 bytes @ 0x0
	global	?_timer1_init
?_timer1_init:	; 0 bytes @ 0x0
	global	?_clock_read
?_clock_read:	; 0 bytes @ 0x0
	global	?_isr
?_isr:	; 0 bytes @ 0x0
	global	??_isr
??_isr:	; 0 bytes @ 0x0
	global	?_main
?_main:	; 0 bytes @ 0x0
	global	?_i2c_read
?_i2c_read:	; 1 bytes @ 0x0
	global	?_i2c_write
?_i2c_write:	; 1 bytes @ 0x0
	ds	7
psect	cstackBANK0,class=BANK0,space=1
global __pcstackBANK0
__pcstackBANK0:
	global	??_i2c_start
??_i2c_start:	; 0 bytes @ 0x0
	global	??_i2c_stop
??_i2c_stop:	; 0 bytes @ 0x0
	global	??_i2c_read
??_i2c_read:	; 0 bytes @ 0x0
	global	??_i2c_write
??_i2c_write:	; 0 bytes @ 0x0
	global	??_i2c_init
??_i2c_init:	; 0 bytes @ 0x0
	global	??_init_port
??_init_port:	; 0 bytes @ 0x0
	global	??_timer1_init
??_timer1_init:	; 0 bytes @ 0x0
	global	i2c_read@ack
i2c_read@ack:	; 1 bytes @ 0x0
	global	i2c_write@d
i2c_write@d:	; 1 bytes @ 0x0
	ds	1
	global	??_clock_read
??_clock_read:	; 0 bytes @ 0x1
	ds	2
	global	??_main
??_main:	; 0 bytes @ 0x3
;;Data sizes: Strings 0, constant 0, data 0, bss 28, persistent 0 stack 0
;;Auto spaces:   Size  Autos    Used
;; COMMON          14      7      13
;; BANK0           80      3      25
;; BANK1           80      0       0
;; BANK3           96      0       0
;; BANK2           96      0       0

;;
;; Pointer list with targets:



;;
;; Critical Paths under _main in COMMON
;;
;;   None.
;;
;; Critical Paths under _isr in COMMON
;;
;;   None.
;;
;; Critical Paths under _main in BANK0
;;
;;   _main->_clock_read
;;   _clock_read->_i2c_write
;;   _clock_read->_i2c_read
;;
;; Critical Paths under _isr in BANK0
;;
;;   None.
;;
;; Critical Paths under _main in BANK1
;;
;;   None.
;;
;; Critical Paths under _isr in BANK1
;;
;;   None.
;;
;; Critical Paths under _main in BANK3
;;
;;   None.
;;
;; Critical Paths under _isr in BANK3
;;
;;   None.
;;
;; Critical Paths under _main in BANK2
;;
;;   None.
;;
;; Critical Paths under _isr in BANK2
;;
;;   None.

;;
;;Main: autosize = 0, tempsize = 0, incstack = 0, save=0
;;

;;
;;Call Graph Tables:
;;
;; ---------------------------------------------------------------------------------
;; (Depth) Function   	        Calls       Base Space   Used Autos Params    Refs
;; ---------------------------------------------------------------------------------
;; (0) _main                                                 0     0      0      62
;;                          _init_port
;;                           _i2c_init
;;                        _timer1_init
;;                         _clock_read
;; ---------------------------------------------------------------------------------
;; (1) _clock_read                                           2     2      0      62
;;                                              1 BANK0      2     2      0
;;                          _i2c_start
;;                          _i2c_write
;;                           _i2c_stop
;;                           _i2c_read
;; ---------------------------------------------------------------------------------
;; (1) _timer1_init                                          0     0      0       0
;; ---------------------------------------------------------------------------------
;; (1) _init_port                                            0     0      0       0
;; ---------------------------------------------------------------------------------
;; (1) _i2c_init                                             0     0      0       0
;; ---------------------------------------------------------------------------------
;; (2) _i2c_write                                            1     1      0      31
;;                                              0 BANK0      1     1      0
;; ---------------------------------------------------------------------------------
;; (2) _i2c_read                                             1     1      0      31
;;                                              0 BANK0      1     1      0
;; ---------------------------------------------------------------------------------
;; (2) _i2c_stop                                             0     0      0       0
;; ---------------------------------------------------------------------------------
;; (2) _i2c_start                                            0     0      0       0
;; ---------------------------------------------------------------------------------
;; Estimated maximum stack depth 2
;; ---------------------------------------------------------------------------------
;; (Depth) Function   	        Calls       Base Space   Used Autos Params    Refs
;; ---------------------------------------------------------------------------------
;; (3) _isr                                                  7     7      0       0
;;                                              0 COMMON     7     7      0
;; ---------------------------------------------------------------------------------
;; Estimated maximum stack depth 3
;; ---------------------------------------------------------------------------------

;; Call Graph Graphs:

;; _main (ROOT)
;;   _init_port
;;   _i2c_init
;;   _timer1_init
;;   _clock_read
;;     _i2c_start
;;     _i2c_write
;;     _i2c_stop
;;     _i2c_read
;;
;; _isr (ROOT)
;;

;; Address spaces:

;;Name               Size   Autos  Total    Cost      Usage
;;BITCOMMON            E      0       0       0        0.0%
;;EEDATA             100      0       0       0        0.0%
;;NULL                 0      0       0       0        0.0%
;;CODE                 0      0       0       0        0.0%
;;COMMON               E      7       D       1       92.9%
;;BITSFR0              0      0       0       1        0.0%
;;SFR0                 0      0       0       1        0.0%
;;BITSFR1              0      0       0       2        0.0%
;;SFR1                 0      0       0       2        0.0%
;;STACK                0      0       2       2        0.0%
;;ABS                  0      0      26       3        0.0%
;;BITBANK0            50      0       0       4        0.0%
;;BITSFR3              0      0       0       4        0.0%
;;SFR3                 0      0       0       4        0.0%
;;BANK0               50      3      19       5       31.3%
;;BITSFR2              0      0       0       5        0.0%
;;SFR2                 0      0       0       5        0.0%
;;BITBANK1            50      0       0       6        0.0%
;;BANK1               50      0       0       7        0.0%
;;BITBANK3            60      0       0       8        0.0%
;;BANK3               60      0       0       9        0.0%
;;BITBANK2            60      0       0      10        0.0%
;;BANK2               60      0       0      11        0.0%
;;DATA                 0      0      28      12        0.0%

	global	_main
psect	maintext,global,class=CODE,delta=2
global __pmaintext
__pmaintext:

;; *************** function _main *****************
;; Defined at:
;;		line 77 in file "D:\working code\trunk\i2c\i2c main.c"
;; Parameters:    Size  Location     Type
;;		None
;; Auto vars:     Size  Location     Type
;;		None
;; Return value:  Size  Location     Type
;;		None               void
;; Registers used:
;;		wreg, status,2, status,0, pclath, cstack
;; Tracked objects:
;;		On entry : 17F/0
;;		On exit  : 0/0
;;		Unchanged: 0/0
;; Data sizes:     COMMON   BANK0   BANK1   BANK3   BANK2
;;      Params:         0       0       0       0       0
;;      Locals:         0       0       0       0       0
;;      Temps:          0       0       0       0       0
;;      Totals:         0       0       0       0       0
;;Total ram usage:        0 bytes
;; Hardware stack levels required when called:    3
;; This function calls:
;;		_init_port
;;		_i2c_init
;;		_timer1_init
;;		_clock_read
;; This function is called by:
;;		Startup code after reset
;; This function uses a non-reentrant model
;;
psect	maintext
	file	"D:\working code\trunk\i2c\i2c main.c"
	line	77
	global	__size_of_main
	__size_of_main	equ	__end_of_main-_main
	
_main:	
	opt	stack 5
; Regs used in _main: [wreg+status,2+status,0+pclath+cstack]
	line	78
	
l5691:	
;i2c main.c: 78: init_port();
	fcall	_init_port
	line	80
	
l5693:	
;i2c main.c: 80: i2c_init();
	fcall	_i2c_init
	line	81
	
l5695:	
;i2c main.c: 81: timer1_init();
	fcall	_timer1_init
	line	82
;i2c main.c: 82: while(1)
	
l2133:	
	line	84
;i2c main.c: 83: {
;i2c main.c: 84: clock_read();
	fcall	_clock_read
	goto	l2133
	line	90
	
l2134:	
	line	82
	goto	l2133
	
l2135:	
	line	91
	
l2136:	
	global	start
	ljmp	start
	opt stack 0
GLOBAL	__end_of_main
	__end_of_main:
;; =============== function _main ends ============

	signat	_main,88
	global	_clock_read
psect	text391,local,class=CODE,delta=2
global __ptext391
__ptext391:

;; *************** function _clock_read *****************
;; Defined at:
;;		line 37 in file "D:\working code\trunk\i2c\i2c main.c"
;; Parameters:    Size  Location     Type
;;		None
;; Auto vars:     Size  Location     Type
;;		None
;; Return value:  Size  Location     Type
;;		None               void
;; Registers used:
;;		wreg, status,2, status,0, pclath, cstack
;; Tracked objects:
;;		On entry : 0/0
;;		On exit  : 0/0
;;		Unchanged: 0/0
;; Data sizes:     COMMON   BANK0   BANK1   BANK3   BANK2
;;      Params:         0       0       0       0       0
;;      Locals:         0       0       0       0       0
;;      Temps:          0       2       0       0       0
;;      Totals:         0       2       0       0       0
;;Total ram usage:        2 bytes
;; Hardware stack levels used:    1
;; Hardware stack levels required when called:    2
;; This function calls:
;;		_i2c_start
;;		_i2c_write
;;		_i2c_stop
;;		_i2c_read
;; This function is called by:
;;		_main
;; This function uses a non-reentrant model
;;
psect	text391
	file	"D:\working code\trunk\i2c\i2c main.c"
	line	37
	global	__size_of_clock_read
	__size_of_clock_read	equ	__end_of_clock_read-_clock_read
	
_clock_read:	
	opt	stack 5
; Regs used in _clock_read: [wreg+status,2+status,0+pclath+cstack]
	line	39
	
l5667:	
;i2c main.c: 39: i2c_start();
	fcall	_i2c_start
	line	41
	
l5669:	
;i2c main.c: 41: i2c_write((0X1C<<1)|0);
	movlw	(038h)
	fcall	_i2c_write
	line	44
	
l5671:	
;i2c main.c: 44: i2c_write(0x00);
	movlw	(0)
	fcall	_i2c_write
	line	47
;i2c main.c: 47: i2c_stop();
	fcall	_i2c_stop
	line	48
;i2c main.c: 48: i2c_start();
	fcall	_i2c_start
	line	51
	
l5673:	
;i2c main.c: 51: i2c_write((0X1C<<1)|1);
	movlw	(039h)
	fcall	_i2c_write
	line	55
	
l5675:	
;i2c main.c: 55: status = i2c_read(0);
	movlw	(0)
	fcall	_i2c_read
	bcf	status, 5	;RP0=0, select bank0
	bcf	status, 6	;RP1=0, select bank0
	movwf	(??_clock_read+0)+0
	clrf	(??_clock_read+0)+0+1
	movf	0+(??_clock_read+0)+0,w
	movwf	(_status)
	movf	1+(??_clock_read+0)+0,w
	movwf	(_status+1)
	line	56
	
l5677:	
;i2c main.c: 56: X_M = i2c_read(0);
	movlw	(0)
	fcall	_i2c_read
	bcf	status, 5	;RP0=0, select bank0
	bcf	status, 6	;RP1=0, select bank0
	movwf	(??_clock_read+0)+0
	clrf	(??_clock_read+0)+0+1
	movf	0+(??_clock_read+0)+0,w
	movwf	(_X_M)
	movf	1+(??_clock_read+0)+0,w
	movwf	(_X_M+1)
	line	57
	
l5679:	
;i2c main.c: 57: X_L = i2c_read(0);
	movlw	(0)
	fcall	_i2c_read
	bcf	status, 5	;RP0=0, select bank0
	bcf	status, 6	;RP1=0, select bank0
	movwf	(??_clock_read+0)+0
	clrf	(??_clock_read+0)+0+1
	movf	0+(??_clock_read+0)+0,w
	movwf	(_X_L)
	movf	1+(??_clock_read+0)+0,w
	movwf	(_X_L+1)
	line	58
	
l5681:	
;i2c main.c: 58: Y_M = i2c_read(0);
	movlw	(0)
	fcall	_i2c_read
	bcf	status, 5	;RP0=0, select bank0
	bcf	status, 6	;RP1=0, select bank0
	movwf	(??_clock_read+0)+0
	clrf	(??_clock_read+0)+0+1
	movf	0+(??_clock_read+0)+0,w
	movwf	(_Y_M)
	movf	1+(??_clock_read+0)+0,w
	movwf	(_Y_M+1)
	line	59
	
l5683:	
;i2c main.c: 59: Y_L = i2c_read(0);
	movlw	(0)
	fcall	_i2c_read
	bcf	status, 5	;RP0=0, select bank0
	bcf	status, 6	;RP1=0, select bank0
	movwf	(??_clock_read+0)+0
	clrf	(??_clock_read+0)+0+1
	movf	0+(??_clock_read+0)+0,w
	movwf	(_Y_L)
	movf	1+(??_clock_read+0)+0,w
	movwf	(_Y_L+1)
	line	60
	
l5685:	
;i2c main.c: 60: Z_M = i2c_read(0);
	movlw	(0)
	fcall	_i2c_read
	bcf	status, 5	;RP0=0, select bank0
	bcf	status, 6	;RP1=0, select bank0
	movwf	(??_clock_read+0)+0
	clrf	(??_clock_read+0)+0+1
	movf	0+(??_clock_read+0)+0,w
	movwf	(_Z_M)
	movf	1+(??_clock_read+0)+0,w
	movwf	(_Z_M+1)
	line	61
	
l5687:	
;i2c main.c: 61: Z_L = i2c_read(1);
	movlw	(01h)
	fcall	_i2c_read
	bcf	status, 5	;RP0=0, select bank0
	bcf	status, 6	;RP1=0, select bank0
	movwf	(??_clock_read+0)+0
	clrf	(??_clock_read+0)+0+1
	movf	0+(??_clock_read+0)+0,w
	movwf	(_Z_L)
	movf	1+(??_clock_read+0)+0,w
	movwf	(_Z_L+1)
	line	64
	
l5689:	
;i2c main.c: 64: i2c_stop();
	fcall	_i2c_stop
	line	65
	
l2126:	
	return
	opt stack 0
GLOBAL	__end_of_clock_read
	__end_of_clock_read:
;; =============== function _clock_read ends ============

	signat	_clock_read,88
	global	_timer1_init
psect	text392,local,class=CODE,delta=2
global __ptext392
__ptext392:

;; *************** function _timer1_init *****************
;; Defined at:
;;		line 22 in file "D:\working code\trunk\i2c\i2c main.c"
;; Parameters:    Size  Location     Type
;;		None
;; Auto vars:     Size  Location     Type
;;		None
;; Return value:  Size  Location     Type
;;		None               void
;; Registers used:
;;		status,2
;; Tracked objects:
;;		On entry : 0/0
;;		On exit  : 0/0
;;		Unchanged: 0/0
;; Data sizes:     COMMON   BANK0   BANK1   BANK3   BANK2
;;      Params:         0       0       0       0       0
;;      Locals:         0       0       0       0       0
;;      Temps:          0       0       0       0       0
;;      Totals:         0       0       0       0       0
;;Total ram usage:        0 bytes
;; Hardware stack levels used:    1
;; Hardware stack levels required when called:    1
;; This function calls:
;;		Nothing
;; This function is called by:
;;		_main
;; This function uses a non-reentrant model
;;
psect	text392
	file	"D:\working code\trunk\i2c\i2c main.c"
	line	22
	global	__size_of_timer1_init
	__size_of_timer1_init	equ	__end_of_timer1_init-_timer1_init
	
_timer1_init:	
	opt	stack 6
; Regs used in _timer1_init: [status,2]
	line	23
	
l5651:	
;i2c main.c: 23: TMR1CS=0;
	bcf	status, 5	;RP0=0, select bank0
	bcf	status, 6	;RP1=0, select bank0
	bcf	(129/8),(129)&7
	line	24
;i2c main.c: 24: T1CKPS1=0;
	bcf	(133/8),(133)&7
	line	25
;i2c main.c: 25: T1CKPS0=0;
	bcf	(132/8),(132)&7
	line	26
	
l5653:	
;i2c main.c: 26: TMR1H=0;
	clrf	(15)	;volatile
	line	27
;i2c main.c: 27: TMR1L=0;
	clrf	(14)	;volatile
	line	28
	
l5655:	
;i2c main.c: 28: TMR1GE=0;
	bcf	(134/8),(134)&7
	line	29
	
l5657:	
;i2c main.c: 29: GIE=1;
	bsf	(95/8),(95)&7
	line	30
	
l5659:	
;i2c main.c: 30: PEIE=1;
	bsf	(94/8),(94)&7
	line	31
	
l5661:	
;i2c main.c: 31: TMR1IE=1;
	bsf	status, 5	;RP0=1, select bank1
	bcf	status, 6	;RP1=0, select bank1
	bsf	(1120/8)^080h,(1120)&7
	line	32
	
l5663:	
;i2c main.c: 32: TMR1IF=0;
	bcf	status, 5	;RP0=0, select bank0
	bcf	status, 6	;RP1=0, select bank0
	bcf	(96/8),(96)&7
	line	33
	
l5665:	
;i2c main.c: 33: TMR1ON=1;
	bsf	(128/8),(128)&7
	line	34
	
l2123:	
	return
	opt stack 0
GLOBAL	__end_of_timer1_init
	__end_of_timer1_init:
;; =============== function _timer1_init ends ============

	signat	_timer1_init,88
	global	_init_port
psect	text393,local,class=CODE,delta=2
global __ptext393
__ptext393:

;; *************** function _init_port *****************
;; Defined at:
;;		line 16 in file "D:\working code\trunk\i2c\i2c main.c"
;; Parameters:    Size  Location     Type
;;		None
;; Auto vars:     Size  Location     Type
;;		None
;; Return value:  Size  Location     Type
;;		None               void
;; Registers used:
;;		status,2
;; Tracked objects:
;;		On entry : 0/0
;;		On exit  : 0/0
;;		Unchanged: 0/0
;; Data sizes:     COMMON   BANK0   BANK1   BANK3   BANK2
;;      Params:         0       0       0       0       0
;;      Locals:         0       0       0       0       0
;;      Temps:          0       0       0       0       0
;;      Totals:         0       0       0       0       0
;;Total ram usage:        0 bytes
;; Hardware stack levels used:    1
;; Hardware stack levels required when called:    1
;; This function calls:
;;		Nothing
;; This function is called by:
;;		_main
;; This function uses a non-reentrant model
;;
psect	text393
	file	"D:\working code\trunk\i2c\i2c main.c"
	line	16
	global	__size_of_init_port
	__size_of_init_port	equ	__end_of_init_port-_init_port
	
_init_port:	
	opt	stack 6
; Regs used in _init_port: [status,2]
	line	17
	
l5649:	
;i2c main.c: 17: TRISB=0;
	bsf	status, 5	;RP0=1, select bank1
	bcf	status, 6	;RP1=0, select bank1
	clrf	(134)^080h	;volatile
	line	18
;i2c main.c: 18: ANSEL=0;
	bsf	status, 5	;RP0=1, select bank3
	bsf	status, 6	;RP1=1, select bank3
	clrf	(392)^0180h	;volatile
	line	19
;i2c main.c: 19: ANSELH=0;
	clrf	(393)^0180h	;volatile
	line	20
	
l2120:	
	return
	opt stack 0
GLOBAL	__end_of_init_port
	__end_of_init_port:
;; =============== function _init_port ends ============

	signat	_init_port,88
	global	_i2c_init
psect	text394,local,class=CODE,delta=2
global __ptext394
__ptext394:

;; *************** function _i2c_init *****************
;; Defined at:
;;		line 39 in file "D:\working code\trunk\i2c\i2c.c"
;; Parameters:    Size  Location     Type
;;		None
;; Auto vars:     Size  Location     Type
;;		None
;; Return value:  Size  Location     Type
;;		None               void
;; Registers used:
;;		wreg, status,2
;; Tracked objects:
;;		On entry : 0/0
;;		On exit  : 0/0
;;		Unchanged: 0/0
;; Data sizes:     COMMON   BANK0   BANK1   BANK3   BANK2
;;      Params:         0       0       0       0       0
;;      Locals:         0       0       0       0       0
;;      Temps:          0       0       0       0       0
;;      Totals:         0       0       0       0       0
;;Total ram usage:        0 bytes
;; Hardware stack levels used:    1
;; Hardware stack levels required when called:    1
;; This function calls:
;;		Nothing
;; This function is called by:
;;		_main
;; This function uses a non-reentrant model
;;
psect	text394
	file	"D:\working code\trunk\i2c\i2c.c"
	line	39
	global	__size_of_i2c_init
	__size_of_i2c_init	equ	__end_of_i2c_init-_i2c_init
	
_i2c_init:	
	opt	stack 6
; Regs used in _i2c_init: [wreg+status,2]
	line	41
	
l5639:	
;i2c.c: 41: RC3 = 1;
	bcf	status, 5	;RP0=0, select bank0
	bcf	status, 6	;RP1=0, select bank0
	bsf	(59/8),(59)&7
	line	42
;i2c.c: 42: RC4 = 1;
	bsf	(60/8),(60)&7
	line	43
;i2c.c: 43: TRISC3 = 1;
	bsf	status, 5	;RP0=1, select bank1
	bcf	status, 6	;RP1=0, select bank1
	bsf	(1083/8)^080h,(1083)&7
	line	44
;i2c.c: 44: TRISC4 = 1;
	bsf	(1084/8)^080h,(1084)&7
	line	46
	
l5641:	
;i2c.c: 46: SSPADD = 9;
	movlw	(09h)
	movwf	(147)^080h	;volatile
	line	47
	
l5643:	
;i2c.c: 47: SMP = 1;
	bsf	(1191/8)^080h,(1191)&7
	line	48
	
l5645:	
;i2c.c: 48: SSPCON2 = 0;
	clrf	(145)^080h	;volatile
	line	49
	
l5647:	
;i2c.c: 49: SSPCON = 0x28;
	movlw	(028h)
	bcf	status, 5	;RP0=0, select bank0
	bcf	status, 6	;RP1=0, select bank0
	movwf	(20)	;volatile
	line	50
	
l1055:	
	return
	opt stack 0
GLOBAL	__end_of_i2c_init
	__end_of_i2c_init:
;; =============== function _i2c_init ends ============

	signat	_i2c_init,88
	global	_i2c_write
psect	text395,local,class=CODE,delta=2
global __ptext395
__ptext395:

;; *************** function _i2c_write *****************
;; Defined at:
;;		line 24 in file "D:\working code\trunk\i2c\i2c.c"
;; Parameters:    Size  Location     Type
;;  d               1    wreg     unsigned char 
;; Auto vars:     Size  Location     Type
;;  d               1    0[BANK0 ] unsigned char 
;; Return value:  Size  Location     Type
;;                  1    wreg      unsigned char 
;; Registers used:
;;		wreg
;; Tracked objects:
;;		On entry : 0/0
;;		On exit  : 0/0
;;		Unchanged: 0/0
;; Data sizes:     COMMON   BANK0   BANK1   BANK3   BANK2
;;      Params:         0       0       0       0       0
;;      Locals:         0       1       0       0       0
;;      Temps:          0       0       0       0       0
;;      Totals:         0       1       0       0       0
;;Total ram usage:        1 bytes
;; Hardware stack levels used:    1
;; Hardware stack levels required when called:    1
;; This function calls:
;;		Nothing
;; This function is called by:
;;		_clock_read
;; This function uses a non-reentrant model
;;
psect	text395
	file	"D:\working code\trunk\i2c\i2c.c"
	line	24
	global	__size_of_i2c_write
	__size_of_i2c_write	equ	__end_of_i2c_write-_i2c_write
	
_i2c_write:	
	opt	stack 5
; Regs used in _i2c_write: [wreg]
;i2c_write@d stored from wreg
	bcf	status, 5	;RP0=0, select bank0
	bcf	status, 6	;RP1=0, select bank0
	movwf	(i2c_write@d)
	line	25
	
l5621:	
;i2c.c: 25: WCOL = 0;
	bcf	(167/8),(167)&7
	line	26
;i2c.c: 26: SSPIF = 0;
	bcf	(99/8),(99)&7
	line	27
	
l5623:	
;i2c.c: 27: SSPBUF = d;
	movf	(i2c_write@d),w
	movwf	(19)	;volatile
	line	28
	
l5625:	
# 28 "D:\working code\trunk\i2c\i2c.c"
nop ;#
psect	text395
	line	29
	
l5627:	
# 29 "D:\working code\trunk\i2c\i2c.c"
nop ;#
psect	text395
	line	30
	
l5629:	
# 30 "D:\working code\trunk\i2c\i2c.c"
nop ;#
psect	text395
	line	31
	
l5631:	
;i2c.c: 31: if(WCOL) return 2;
	bcf	status, 5	;RP0=0, select bank0
	bcf	status, 6	;RP1=0, select bank0
	btfss	(167/8),(167)&7
	goto	u2501
	goto	u2500
u2501:
	goto	l1049
u2500:
	goto	l1047
	
l5633:	
;	Return value of _i2c_write is never used
	goto	l1047
	
l5635:	
	goto	l1047
	line	32
	
l1046:	
	line	33
;i2c.c: 32: else {
;i2c.c: 33: while(!SSPIF);
	goto	l1049
	
l1050:	
	
l1049:	
	btfss	(99/8),(99)&7
	goto	u2511
	goto	u2510
u2511:
	goto	l1049
u2510:
	
l1051:	
	line	34
;i2c.c: 34: if(ACKSTAT) return 1;
	goto	l1047
	
l5637:	
;	Return value of _i2c_write is never used
	goto	l1047
	
l1052:	
	line	35
;i2c.c: 35: return 0;
;	Return value of _i2c_write is never used
	goto	l1047
	line	36
	
l1048:	
	line	37
	
l1047:	
	return
	opt stack 0
GLOBAL	__end_of_i2c_write
	__end_of_i2c_write:
;; =============== function _i2c_write ends ============

	signat	_i2c_write,4217
	global	_i2c_read
psect	text396,local,class=CODE,delta=2
global __ptext396
__ptext396:

;; *************** function _i2c_read *****************
;; Defined at:
;;		line 14 in file "D:\working code\trunk\i2c\i2c.c"
;; Parameters:    Size  Location     Type
;;  ack             1    wreg     unsigned char 
;; Auto vars:     Size  Location     Type
;;  ack             1    0[BANK0 ] unsigned char 
;; Return value:  Size  Location     Type
;;                  1    wreg      unsigned char 
;; Registers used:
;;		wreg
;; Tracked objects:
;;		On entry : 0/0
;;		On exit  : 0/0
;;		Unchanged: 0/0
;; Data sizes:     COMMON   BANK0   BANK1   BANK3   BANK2
;;      Params:         0       0       0       0       0
;;      Locals:         0       1       0       0       0
;;      Temps:          0       0       0       0       0
;;      Totals:         0       1       0       0       0
;;Total ram usage:        1 bytes
;; Hardware stack levels used:    1
;; Hardware stack levels required when called:    1
;; This function calls:
;;		Nothing
;; This function is called by:
;;		_clock_read
;; This function uses a non-reentrant model
;;
psect	text396
	file	"D:\working code\trunk\i2c\i2c.c"
	line	14
	global	__size_of_i2c_read
	__size_of_i2c_read	equ	__end_of_i2c_read-_i2c_read
	
_i2c_read:	
	opt	stack 5
; Regs used in _i2c_read: [wreg]
;i2c_read@ack stored from wreg
	bcf	status, 5	;RP0=0, select bank0
	bcf	status, 6	;RP1=0, select bank0
	movwf	(i2c_read@ack)
	line	15
	
l5615:	
;i2c.c: 15: RCEN = 1;
	bsf	status, 5	;RP0=1, select bank1
	bcf	status, 6	;RP1=0, select bank1
	bsf	(1163/8)^080h,(1163)&7
	line	16
;i2c.c: 16: while(RCEN);
	goto	l1037
	
l1038:	
	
l1037:	
	btfsc	(1163/8)^080h,(1163)&7
	goto	u2461
	goto	u2460
u2461:
	goto	l1037
u2460:
	
l1039:	
	line	18
;i2c.c: 18: ACKDT = ack;
	bcf	status, 5	;RP0=0, select bank0
	bcf	status, 6	;RP1=0, select bank0
	btfsc	(i2c_read@ack),0
	goto	u2471
	goto	u2470
	
u2471:
	bsf	status, 5	;RP0=1, select bank1
	bcf	status, 6	;RP1=0, select bank1
	bsf	(1165/8)^080h,(1165)&7
	goto	u2484
u2470:
	bsf	status, 5	;RP0=1, select bank1
	bcf	status, 6	;RP1=0, select bank1
	bcf	(1165/8)^080h,(1165)&7
u2484:
	line	19
;i2c.c: 19: ACKEN = 1;
	bsf	(1164/8)^080h,(1164)&7
	line	20
;i2c.c: 20: while(ACKEN);
	goto	l1040
	
l1041:	
	
l1040:	
	btfsc	(1164/8)^080h,(1164)&7
	goto	u2491
	goto	u2490
u2491:
	goto	l1040
u2490:
	goto	l5617
	
l1042:	
	line	22
	
l5617:	
;i2c.c: 22: return SSPBUF;
	bcf	status, 5	;RP0=0, select bank0
	bcf	status, 6	;RP1=0, select bank0
	movf	(19),w	;volatile
	goto	l1043
	
l5619:	
	line	23
	
l1043:	
	return
	opt stack 0
GLOBAL	__end_of_i2c_read
	__end_of_i2c_read:
;; =============== function _i2c_read ends ============

	signat	_i2c_read,4217
	global	_i2c_stop
psect	text397,local,class=CODE,delta=2
global __ptext397
__ptext397:

;; *************** function _i2c_stop *****************
;; Defined at:
;;		line 9 in file "D:\working code\trunk\i2c\i2c.c"
;; Parameters:    Size  Location     Type
;;		None
;; Auto vars:     Size  Location     Type
;;		None
;; Return value:  Size  Location     Type
;;		None               void
;; Registers used:
;;		None
;; Tracked objects:
;;		On entry : 0/0
;;		On exit  : 0/0
;;		Unchanged: 0/0
;; Data sizes:     COMMON   BANK0   BANK1   BANK3   BANK2
;;      Params:         0       0       0       0       0
;;      Locals:         0       0       0       0       0
;;      Temps:          0       0       0       0       0
;;      Totals:         0       0       0       0       0
;;Total ram usage:        0 bytes
;; Hardware stack levels used:    1
;; Hardware stack levels required when called:    1
;; This function calls:
;;		Nothing
;; This function is called by:
;;		_clock_read
;; This function uses a non-reentrant model
;;
psect	text397
	file	"D:\working code\trunk\i2c\i2c.c"
	line	9
	global	__size_of_i2c_stop
	__size_of_i2c_stop	equ	__end_of_i2c_stop-_i2c_stop
	
_i2c_stop:	
	opt	stack 5
; Regs used in _i2c_stop: []
	line	10
	
l5613:	
;i2c.c: 10: PEN = 1;
	bsf	status, 5	;RP0=1, select bank1
	bcf	status, 6	;RP1=0, select bank1
	bsf	(1162/8)^080h,(1162)&7
	line	11
;i2c.c: 11: while(PEN);
	goto	l1031
	
l1032:	
	
l1031:	
	btfsc	(1162/8)^080h,(1162)&7
	goto	u2451
	goto	u2450
u2451:
	goto	l1031
u2450:
	goto	l1034
	
l1033:	
	line	13
	
l1034:	
	return
	opt stack 0
GLOBAL	__end_of_i2c_stop
	__end_of_i2c_stop:
;; =============== function _i2c_stop ends ============

	signat	_i2c_stop,88
	global	_i2c_start
psect	text398,local,class=CODE,delta=2
global __ptext398
__ptext398:

;; *************** function _i2c_start *****************
;; Defined at:
;;		line 4 in file "D:\working code\trunk\i2c\i2c.c"
;; Parameters:    Size  Location     Type
;;		None
;; Auto vars:     Size  Location     Type
;;		None
;; Return value:  Size  Location     Type
;;		None               void
;; Registers used:
;;		None
;; Tracked objects:
;;		On entry : 0/0
;;		On exit  : 0/0
;;		Unchanged: 0/0
;; Data sizes:     COMMON   BANK0   BANK1   BANK3   BANK2
;;      Params:         0       0       0       0       0
;;      Locals:         0       0       0       0       0
;;      Temps:          0       0       0       0       0
;;      Totals:         0       0       0       0       0
;;Total ram usage:        0 bytes
;; Hardware stack levels used:    1
;; Hardware stack levels required when called:    1
;; This function calls:
;;		Nothing
;; This function is called by:
;;		_clock_read
;; This function uses a non-reentrant model
;;
psect	text398
	file	"D:\working code\trunk\i2c\i2c.c"
	line	4
	global	__size_of_i2c_start
	__size_of_i2c_start	equ	__end_of_i2c_start-_i2c_start
	
_i2c_start:	
	opt	stack 5
; Regs used in _i2c_start: []
	line	5
	
l5611:	
;i2c.c: 5: SEN = 1;
	bsf	status, 5	;RP0=1, select bank1
	bcf	status, 6	;RP1=0, select bank1
	bsf	(1160/8)^080h,(1160)&7
	line	6
;i2c.c: 6: while(SEN);
	goto	l1025
	
l1026:	
	
l1025:	
	btfsc	(1160/8)^080h,(1160)&7
	goto	u2441
	goto	u2440
u2441:
	goto	l1025
u2440:
	goto	l1028
	
l1027:	
	line	8
	
l1028:	
	return
	opt stack 0
GLOBAL	__end_of_i2c_start
	__end_of_i2c_start:
;; =============== function _i2c_start ends ============

	signat	_i2c_start,88
	global	_isr
psect	text399,local,class=CODE,delta=2
global __ptext399
__ptext399:

;; *************** function _isr *****************
;; Defined at:
;;		line 67 in file "D:\working code\trunk\i2c\i2c main.c"
;; Parameters:    Size  Location     Type
;;		None
;; Auto vars:     Size  Location     Type
;;		None
;; Return value:  Size  Location     Type
;;		None               void
;; Registers used:
;;		wreg
;; Tracked objects:
;;		On entry : 0/0
;;		On exit  : 0/0
;;		Unchanged: 0/0
;; Data sizes:     COMMON   BANK0   BANK1   BANK3   BANK2
;;      Params:         0       0       0       0       0
;;      Locals:         0       0       0       0       0
;;      Temps:          7       0       0       0       0
;;      Totals:         7       0       0       0       0
;;Total ram usage:        7 bytes
;; Hardware stack levels used:    1
;; This function calls:
;;		Nothing
;; This function is called by:
;;		Interrupt level 1
;; This function uses a non-reentrant model
;;
psect	text399
	file	"D:\working code\trunk\i2c\i2c main.c"
	line	67
	global	__size_of_isr
	__size_of_isr	equ	__end_of_isr-_isr
	
_isr:	
	opt	stack 5
; Regs used in _isr: [wreg]
psect	intentry,class=CODE,delta=2
global __pintentry
__pintentry:
global interrupt_function
interrupt_function:
	global saved_w
	saved_w	set	btemp+0
	movwf	saved_w
	swapf	status,w
	movwf	(??_isr+3)
	movf	fsr0,w
	movwf	(??_isr+4)
	movf	pclath,w
	movwf	(??_isr+5)
	bcf	status, 5	;RP0=0, select bank0
	bcf	status, 6	;RP1=0, select bank0
	movf	btemp+1,w
	movwf	(??_isr+6)
	ljmp	_isr
psect	text399
	line	68
	
i1l4599:	
;i2c main.c: 68: if(TMR1IF&&TMR1IE)
	btfss	(96/8),(96)&7
	goto	u9_21
	goto	u9_20
u9_21:
	goto	i1l2130
u9_20:
	
i1l4601:	
	bsf	status, 5	;RP0=1, select bank1
	bcf	status, 6	;RP1=0, select bank1
	btfss	(1120/8)^080h,(1120)&7
	goto	u10_21
	goto	u10_20
u10_21:
	goto	i1l2130
u10_20:
	line	70
	
i1l4603:	
;i2c main.c: 69: {
;i2c main.c: 70: PORTB=X_L;
	movf	(_X_L),w
	bcf	status, 5	;RP0=0, select bank0
	bcf	status, 6	;RP1=0, select bank0
	movwf	(6)	;volatile
	line	71
;i2c main.c: 71: _delay((unsigned long)((500)*(4000000/4000.0)));
	opt asmopt_off
movlw  3
movwf	((??_isr+0)+0+2),f
movlw	138
movwf	((??_isr+0)+0+1),f
	movlw	86
movwf	((??_isr+0)+0),f
u252_27:
	decfsz	((??_isr+0)+0),f
	goto	u252_27
	decfsz	((??_isr+0)+0+1),f
	goto	u252_27
	decfsz	((??_isr+0)+0+2),f
	goto	u252_27
	nop2
opt asmopt_on

	line	72
;i2c main.c: 72: PORTB=Y_L;
	movf	(_Y_L),w
	bcf	status, 5	;RP0=0, select bank0
	bcf	status, 6	;RP1=0, select bank0
	movwf	(6)	;volatile
	line	73
;i2c main.c: 73: _delay((unsigned long)((500)*(4000000/4000.0)));
	opt asmopt_off
movlw  3
movwf	((??_isr+0)+0+2),f
movlw	138
movwf	((??_isr+0)+0+1),f
	movlw	86
movwf	((??_isr+0)+0),f
u253_27:
	decfsz	((??_isr+0)+0),f
	goto	u253_27
	decfsz	((??_isr+0)+0+1),f
	goto	u253_27
	decfsz	((??_isr+0)+0+2),f
	goto	u253_27
	nop2
opt asmopt_on

	goto	i1l2130
	line	74
	
i1l2129:	
	line	75
	
i1l2130:	
	movf	(??_isr+6),w
	bcf	status, 5	;RP0=0, select bank0
	bcf	status, 6	;RP1=0, select bank0
	movwf	btemp+1
	movf	(??_isr+5),w
	movwf	pclath
	movf	(??_isr+4),w
	movwf	fsr0
	swapf	(??_isr+3)^0FFFFFF80h,w
	movwf	status
	swapf	saved_w,f
	swapf	saved_w,w
	retfie
	opt stack 0
GLOBAL	__end_of_isr
	__end_of_isr:
;; =============== function _isr ends ============

	signat	_isr,88
psect	text400,local,class=CODE,delta=2
global __ptext400
__ptext400:
	global	btemp
	btemp set 07Eh

	DABS	1,126,2	;btemp
	global	wtemp0
	wtemp0 set btemp
	end
